package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.WindowConstants;


import bean.JTextFieldValidator;

import controlador.ControladorJFJugador;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class JFJugador extends javax.swing.JFrame {
	private JPanel JPUsuario;
	private JLabel lblUsuario;
	private JTextFieldValidator txtUsuario;
	private JLabel Lbltitulo;
	private JButton btnaceptar;

	public JFJugador() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Jugador");
			{
				JPUsuario = new JPanel();
				getContentPane().add(JPUsuario, BorderLayout.CENTER);
				JPUsuario.setLayout(null);
				JPUsuario.setPreferredSize(new java.awt.Dimension(438, 154));
				{
					lblUsuario = new JLabel();
					JPUsuario.add(lblUsuario);
					lblUsuario.setText("Usuario:");
					lblUsuario.setBounds(12, 40, 151, 30);
					lblUsuario.setFont(new java.awt.Font("Purisa",1,20));
				}
				{
					txtUsuario = new JTextFieldValidator(JTextFieldValidator.SOLO_LETRAS);
					JPUsuario.add(txtUsuario);
					txtUsuario.setMaximaLongitud(10);
					txtUsuario.setBounds(123, 44, 276, 30);
					txtUsuario.setFont(new java.awt.Font("Purisa",1,16));
				}
				{
					btnaceptar = new JButton();
					JPUsuario.add(btnaceptar);
					{
						Lbltitulo = new JLabel();
						JPUsuario.add(Lbltitulo);
						Lbltitulo.setText("Has Ganado");
						Lbltitulo.setBounds(162, 12, 122, 22);
					}
					btnaceptar.setText("Aceptar");
					btnaceptar.setFont(new java.awt.Font("Purisa",1,14));
					btnaceptar.setBounds(181, 102, 100, 30);
					btnaceptar.setActionCommand("Aceptar");
					
								
			}
			}
			pack();
			this.setSize(448, 187);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
		
	}
	
	public void agregarListener (ActionListener actionListener)
	{
		btnaceptar.addActionListener(actionListener);
	}

	public String getTxtUsuario() {
		return txtUsuario.getText();
	}

	public void setTxtUsuario(JTextFieldValidator txtUsuario) {
		this.txtUsuario = txtUsuario;
	}
	
	public JButton getBtnaceptar() {
		return btnaceptar;
	}

	public void setBtnaceptar(JButton btnaceptar) {
		this.btnaceptar = btnaceptar;
	}

	public void mostrarMensaje(String mensaje)
	{
		JOptionPane.showMessageDialog(this, mensaje);
	}

	public void Limpiar()
	{
		txtUsuario.setText(" ");
	}

}